package cn.wolfcode.mapper;

import cn.wolfcode.domain.Department;
import cn.wolfcode.domain.Employee;
import cn.wolfcode.domain.Role;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAllEmp();
    List<Employee> listAll();
    List<Employee> selectAll(QueryObject qo);

    int updateByPrimaryKey(Employee record);
    //根据emp的id查角色
    List<Role> selectRolesByEId(Long id);

    Employee check(@Param("username") String username, @Param("password") String password);

    void updateById(@Param("id") Long id, @Param("p_new") String password_new);

    List<String> selectPermissionsByEId(Long id);

    Employee selectByUsername(String username);

    boolean getStatus(@Param("username") String username, @Param("password") String password);

    void changeStatus(@Param("status") boolean status, @Param("id") Long id);
}